<?php

/**
 * SignoVital form base class.
 *
 * @method SignoVital getObject() Returns the current form's model object
 *
 * @package    sibi-salud
 * @subpackage form
 * @author     SIBI <sibiud@gmail.com>
 */
abstract class BaseSignoVitalForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'cita_medica_id'          => new sfWidgetFormPropelChoice(array('model' => 'CitaMedica', 'add_empty' => true)),
      'peso'                    => new sfWidgetFormInputText(),
      'talla'                   => new sfWidgetFormInputText(),
      'tension_arterial'        => new sfWidgetFormInputText(),
      'frecuencia_cardiaca'     => new sfWidgetFormInputText(),
      'frecuencia_respiratoria' => new sfWidgetFormInputText(),
      'temperatura_corporal'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorPropelChoice(array('model' => 'SignoVital', 'column' => 'id', 'required' => false)),
      'cita_medica_id'          => new sfValidatorPropelChoice(array('model' => 'CitaMedica', 'column' => 'id', 'required' => false)),
      'peso'                    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'talla'                   => new sfValidatorNumber(array('required' => false)),
      'tension_arterial'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'frecuencia_cardiaca'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'frecuencia_respiratoria' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'temperatura_corporal'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('signo_vital[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SignoVital';
  }


}
